#!/bin/sh
echo "channel=$1"
echo "antenna=$2"
echo "bandwidth=$3"

./wl -i eth6 down
./wl -i eth6 mpc 0
./wl -i eth6 country ALL
./wl -i eth6 vht_features 3
./wl -i eth6 srl 7
./wl -i eth6 lrl 6
./wl -i eth6 fast_timer 15
./wl -i eth6 glacial_timer 120
./wl -i eth6 slow_timer 60
./wl -i eth6 phy_watchdog 1
./wl -i eth6 rxchain 15
./wl -i eth6 txchain 15
./wl -i eth6 band auto
./wl -i eth6 txbf 0
./wl -i eth6 stbc_tx 0
./wl -i eth6 stbc_rx 0
./wl -i eth6 ap 1
./wl -i eth6 bw_cap 2g 0x3
./wl -i eth6 bw_cap 5g 0x7
./wl -i eth6 wme_bss_disable 0
./wl -i eth6 wsec 0x0
./wl -i eth6 wpa_auth 0x0
./wl -i eth6 ampdu_txaggr 1

if [ $3 -eq 40 ];
    then
        ./wl -i eth6 chanspec $1/$3l
else
        ./wl -i eth6 chanspec $1/$3
fi
./wl -i eth6 5g_rate auto

./wl -i eth6 rxchain $2
./wl -i eth6 txchain $2
./wl -i eth6 txcore -s 1 -c $2 -o $2 -k $2
./wl -i eth6 vht_features 6
./wl -i eth6 nmode 1
./wl -i eth6 vhtmode 1
./wl -i eth6 up
./wl -i eth6 down
./wl -i eth6 rateset all

./wl -i eth6 up
./wl -i eth6 isup
./wl -i eth6 mpc 1
./wl -i eth6 mpc 0
./wl -i eth6 up
./wl -i eth6 isup
./wl -i eth6 phy_forcecal 1
./wl -i eth6 ssid wifi_5g
./wl -i eth6 txpwr1 -o -q 40
./wl -i eth6 rateset
./wl -i eth6 status
